package basic.Generic;

import java.util.ArrayList;
import java.util.List;

//泛型特性：编译器类型擦除后，类型都变为它修饰的类的类型
public class PropertiesDemo {

    public void property(){
        List<String> stringArrayList = new ArrayList<String>();
        List<Integer> integerArrayList = new ArrayList<Integer>();

        Class classStringArrayList = stringArrayList.getClass();
        System.out.println(classStringArrayList);//class java.util.ArrayList
        Class classIntegerArrayList = integerArrayList.getClass();
        System.out.println(classIntegerArrayList);//class java.util.ArrayList

        if(classStringArrayList.equals(classIntegerArrayList)){
            System.out.println("泛型测试"+"类型相同");//泛型测试类型相同
        }
    }
}
